![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
Class for storing data for optimisation. More...
#include <farm.h>
Classes | |
class | FarmData |
Class storing farm information: farm's number used in ALMaSS system, farm's soil type, farm's size (business or private) and farm's real ID number. More... | |
Public Member Functions | |
DataForOptimisation () | |
The constructor. More... | |
void | Set_livestockTypes (TTypesOfAnimals livestock_type) |
void | Set_cropTypes (TTypesOfCrops crop_type) |
void | Set_cropTypes_str (string crop_type) |
TTypesOfAnimals | Get_livestockTypes (int i) |
string | Get_cropTypes_str (int i) |
TTypesOfCrops | Get_cropTypes (int i) |
void | Set_livestockNumber (int a_number) |
void | Set_cropArea (double a_area) |
int | Get_livestockNumber (int index) |
int | Get_livestockNumbersSize () |
double | Get_cropArea (int index) |
int | Get_cropAreasSize () |
TTypesOfOptFarms | Get_farmType (int a_almass_no) |
Used by FarmManager::CreateFarms. Finds a matching almass number and returns farm's type. More... | |
void | Set_winterMax (int a_value, int i) |
int | Get_winterMax (int i) |
void | Set_livestockParameter (double a_value, int i) |
double | Get_livestockParameter (int i) |
void | Set_cropParameter (double a_value, int i) |
double | Get_cropParameter (int i) |
void | Set_alfa (double a_value, int i) |
double | Get_alfa (int i) |
void | Set_beta1 (double a_value, int i) |
double | Get_beta1 (int i) |
void | Set_beta2 (double a_value, int i) |
double | Get_beta2 (int i) |
void | Set_Nnorm (double a_value, int i) |
double | Get_Nnorm (int i) |
void | Set_fixed (string a_value, int i) |
bool | Get_fixed (int i) |
void | Set_fodder (string a_value, int i) |
bool | Get_fodder (int i) |
void | Set_FUKey (double a_value, int i) |
double | Get_FUKey (int i) |
void | Set_sellingPrice (double a_value, int i) |
double | Get_sellingPrice (int i) |
void | Set_sellingPrice_lastyr (double a_value, int i) |
double | Get_sellingPrice_lastyr (int i) |
void | Set_rotationMax (double a_value, int i) |
double | Get_rotationMax (int i) |
void | Set_rotationMin (double a_value, int i) |
double | Get_rotationMin (int i) |
void | Set_biomass_factor (double a_value, int i) |
double | Get_biomass_factor (int i) |
void | Set_cropTypes_almass (TTypesOfVegetation crop_type) |
TTypesOfVegetation | Get_cropTypes_almass (int i) |
int | Get_cropTypes_almass_size () |
void | Set_cropTypes_almass_str (string crop_type) |
string | Get_cropTypes_almass_str (int i) |
void | Set_noCrops (int no) |
int | Get_noCrops () |
void | Set_emaize_price (double a_value) |
double | Get_emaize_price (int i) |
Public Attributes | |
vector< FarmData * > | m_farm_data |
Protected Member Functions | |
void | InitializeVector (vector< double > &vector) |
Initializes vector with -1 values. More... | |
Protected Attributes | |
int | m_noCrops |
Number of crops used in the simulation. More... | |
vector< string > | m_str_cropTypes |
Crop types saved in string format (Bedriftsmodel i.e. original crop optimization model crop mode). More... | |
vector< TTypesOfCrops > | m_cropTypes |
Crop types saved as enumarator types (Bedriftsmodel i.e. original crop optimization model crop mode). More... | |
vector< string > | m_str_cropTypes_almass |
Crop types saved in string format (ALMaSS crop mode). More... | |
vector< TTypesOfVegetation > | m_cropTypes_almass |
Crop types saved as enumarator types (ALMaSS crop mode). More... | |
vector< TTypesOfAnimals > | m_livestockTypes |
Livestock types saved as enumarator types. More... | |
vector< double > | m_cropAreas |
Vector containing values of initial (i.e. in year the data is taken for) crop areas at farms included in the simulation. More... | |
vector< int > | m_livestockNumbers |
Vector containing numbers of all livestock types at farms included in the simulation. More... | |
vector< int > | m_winterMax |
Maximal area taken by winter crops at a farm. [%]. More... | |
vector< double > | m_livestockParameters |
Vector storing parameters of all livestock types. More... | |
vector< double > | m_cropParameters |
Vector storing parameters of all crop types. More... | |
vector< double > | m_alfa |
Crop parameter for response (growth) function (resp = alfa + beta1*N + beta2*N^2; defines relationship between yield and fertilizer). Soil type specific. More... | |
vector< double > | m_beta1 |
Crop parameter for response (growth) function (resp = alfa + beta1*N + beta2*N^2; defines relationship between yield and fertilizer). Soil type specific. More... | |
vector< double > | m_beta2 |
Crop parameter for response (growth) function (resp = alfa + beta1*N + beta2*N^2; defines relationship between yield and fertilizer). Soil type specific. More... | |
vector< double > | m_Nnorm |
Maximum amount of fertilizer (N) that can be applied for a given crop [kg N/ha]. Soil specific. More... | |
vector< double > | m_biomass_factors |
Factor used to determine actual response (yield per ha) based on crop biomass at a harvest. Factor is crop specific and is equal to a ratio of the response for optimal fertilizer amount in Bedriftsmodel (original farm optimization model) to the biomass at a harvest for the corresponding ALMaSS crop grown with optimal fertilizer input. More... | |
vector< bool > | m_fixed |
Crop Boolean parameter - fixed/variable crop. Farm type specific. More... | |
vector< bool > | m_fodder |
Crop Boolean parameter - fodder/non-fodder crop. Farm type specific. More... | |
vector< double > | m_FUKey |
Crop parameter: Fodder unit key, i.e. a number of fodder units obtained from a given crop [FU/hkg]. Farm type specific. More... | |
vector< double > | m_sellingPrice |
Selling price of a crop [DKK/hkg]. Farm type specific and soil type specific. More... | |
vector< double > | m_sellingPrice_lastyr |
Selling price of a crop in a previous year [DKK/hkg]. Farm type specific and soil type specific. More... | |
vector< double > | m_rotationMax |
Maximum acreage of a crop at a farm [%]. Farm type, soil type and farm size specific. More... | |
vector< double > | m_rotationMin |
Minimum acreage of a crop at a farm [%]. Farm type, soil type and farm size specific. More... | |
vector< double > | m_energy_maize_price |
Vector with energy maize prices for each year of simulation. More... | |
Class for storing data for optimisation.
DataForOptimisation::DataForOptimisation | ( | ) |
The constructor.
References cfg_OptimiseBedriftsmodelCrops, InitializeVector(), m_alfa, m_beta1, m_beta2, m_biomass_factors, m_cropParameters, m_fixed, m_fodder, m_FUKey, m_livestockParameters, m_Nnorm, m_rotationMax, m_rotationMin, m_sellingPrice, m_sellingPrice_lastyr, m_winterMax, toa_Foobar, toc_Foobar, tofs_Foobar, tolp_Foobar, toof_Foobar, top_Foobar, tos_Foobar, tov_Undefined, and CfgBool::value().
|
inline |
|
inline |
References m_beta1.
Referenced by OptimisingFarm::ActualProfit(), OptimisingFarm::findFertilizer(), and OptimisingFarm::findResponse().
|
inline |
References m_beta2.
Referenced by OptimisingFarm::ActualProfit(), OptimisingFarm::findFertilizer(), and OptimisingFarm::findResponse().
|
inline |
|
inline |
References m_cropAreas.
Referenced by OptimisingFarm::Initialize().
|
inline |
|
inline |
|
inline |
References m_cropTypes.
Referenced by OptimisingFarm::Initialize().
|
inline |
References m_cropTypes_almass.
Referenced by OptimisingFarm::ActualProfit(), FarmManager::FarmManager(), OptimisingFarm::Initialize(), FarmManager::ReadCropsData_almass(), FarmManager::ReadCropsData_perFarm_and_Soil_almass(), FarmManager::ReadCropsData_perFarm_and_Soil_and_Size_almass(), FarmManager::ReadCropsData_perFarmType_almass(), FarmManager::ReadCropsData_perSoilType_almass(), and FarmManager::Switch_rotation().
|
inline |
References m_cropTypes_almass.
Referenced by OptimisingFarm::ActualProfit(), and FarmManager::Switch_rotation().
|
inline |
References m_str_cropTypes_almass.
Referenced by FarmManager::OptimisationOutput(), FarmManager::PrintFinalResults(), and FarmManager::PrintOutput().
|
inline |
References m_str_cropTypes.
Referenced by FarmManager::OptimisationOutput(), and FarmManager::PrintOutput().
|
inline |
References m_energy_maize_price.
TTypesOfOptFarms DataForOptimisation::Get_farmType | ( | int | a_almass_no | ) |
Used by FarmManager::CreateFarms. Finds a matching almass number and returns farm's type.
References g_msg, m_farm_data, MapErrorMsg::Warn(), and WARN_BUG.
Referenced by FarmManager::CreateFarms().
|
inline |
References m_fixed.
Referenced by AnimalFarm::createFodderCrops(), and OptimisingFarm::createVariableCrops().
|
inline |
References m_fodder.
Referenced by OptimisingFarm::ActualProfit(), OptimisingCattleFarm::checkCattleRotation(), AnimalFarm::checkWinterRotation1(), AnimalFarm::createFodderCrops(), AnimalFarm::decreaseCrops(), OptimisingFarm::determineAreas(), OptimisingFarm::findGrossMargin(), AnimalFarm::increaseCrops(), OptimisingFarm::optimizeCrops(), and OptimisingCattleFarm::setCattleCropsAtMin().
|
inline |
References m_FUKey.
Referenced by OptimisingPigFarm::check_WRape_WBarley(), OptimisingCattleFarm::checkCattleRotation(), OptimisingCattleFarm::checkCattleRotation_almass(), AnimalFarm::checkWinterRotation1(), AnimalFarm::correctFodderDemand(), AnimalFarm::decreaseCrops(), AnimalFarm::determineFodderAreas(), AnimalFarm::determineMinFodder(), AnimalFarm::increaseCrops(), OptimisingFarm::optimizeCrops(), and OptimisingCattleFarm::setCattleCropsAtMin().
|
inline |
References m_livestockNumbers.
Referenced by OptimisingFarm::Initialize().
|
inline |
|
inline |
References m_livestockParameters.
Referenced by OptimisingFarm::findFodderDemand(), and OptimisingFarm::findTotalNanim().
|
inline |
References m_livestockTypes.
Referenced by OptimisingFarm::Initialize().
|
inline |
|
inline |
References m_noCrops.
Referenced by OptimisingFarm::ActualProfit(), FarmManager::CropDistribution(), FarmManager::FarmManager(), OptimisingFarm::Initialize(), FarmManager::OptimisationOutput(), FarmManager::PrintFinalResults(), and FarmManager::PrintOutput().
|
inline |
|
inline |
|
inline |
References m_sellingPrice.
Referenced by OptimisingFarm::ActualProfit(), and OptimisingFarm::optimizeCrops().
|
inline |
|
inline |
References m_winterMax.
Referenced by OptimisingPigFarm::check_WRape_WBarley(), AnimalFarm::checkWinterCrops(), and NonAnimalFarm::checkWinterCrops().
|
protected |
Initializes vector with -1 values.
Referenced by DataForOptimisation().
|
inline |
References m_alfa.
Referenced by FarmManager::ReadCropsData_perSoilType(), and FarmManager::ReadCropsData_perSoilType_almass().
|
inline |
References m_beta1.
Referenced by FarmManager::ReadCropsData_perSoilType(), and FarmManager::ReadCropsData_perSoilType_almass().
|
inline |
References m_beta2.
Referenced by FarmManager::ReadCropsData_perSoilType(), and FarmManager::ReadCropsData_perSoilType_almass().
|
inline |
|
inline |
References m_cropAreas.
Referenced by FarmManager::ReadInitialCropAreas(), and FarmManager::ReadInitialCropAreas_almass().
|
inline |
References m_cropParameters.
Referenced by FarmManager::ReadCropsData(), and FarmManager::ReadCropsData_almass().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References m_fixed.
Referenced by FarmManager::ReadCropsData_perFarmType(), and FarmManager::ReadCropsData_perFarmType_almass().
|
inline |
References m_fodder.
Referenced by FarmManager::ReadCropsData_perFarmType(), and FarmManager::ReadCropsData_perFarmType_almass().
|
inline |
References m_FUKey.
Referenced by FarmManager::ReadCropsData_perFarmType(), and FarmManager::ReadCropsData_perFarmType_almass().
|
inline |
|
inline |
|
inline |
|
inline |
References m_Nnorm.
Referenced by FarmManager::ReadCropsData_perSoilType(), and FarmManager::ReadCropsData_perSoilType_almass().
|
inline |
|
inline |
References m_rotationMax.
Referenced by FarmManager::ReadCropsData_perFarm_and_Soil_and_Size(), and FarmManager::ReadCropsData_perFarm_and_Soil_and_Size_almass().
|
inline |
References m_rotationMin.
Referenced by FarmManager::ReadCropsData_perFarm_and_Soil_and_Size(), and FarmManager::ReadCropsData_perFarm_and_Soil_and_Size_almass().
|
inline |
References m_sellingPrice.
Referenced by FarmManager::ReadCropsData_perFarm_and_Soil(), and FarmManager::ReadCropsData_perFarm_and_Soil_almass().
|
inline |
References m_sellingPrice_lastyr.
|
inline |
|
protected |
Crop parameter for response (growth) function (resp = alfa + beta1*N + beta2*N^2; defines relationship between yield and fertilizer). Soil type specific.
Referenced by DataForOptimisation(), Get_alfa(), and Set_alfa().
|
protected |
Crop parameter for response (growth) function (resp = alfa + beta1*N + beta2*N^2; defines relationship between yield and fertilizer). Soil type specific.
Referenced by DataForOptimisation(), Get_beta1(), and Set_beta1().
|
protected |
Crop parameter for response (growth) function (resp = alfa + beta1*N + beta2*N^2; defines relationship between yield and fertilizer). Soil type specific.
Referenced by DataForOptimisation(), Get_beta2(), and Set_beta2().
|
protected |
Factor used to determine actual response (yield per ha) based on crop biomass at a harvest. Factor is crop specific and is equal to a ratio of the response for optimal fertilizer amount in Bedriftsmodel (original farm optimization model) to the biomass at a harvest for the corresponding ALMaSS crop grown with optimal fertilizer input.
Referenced by DataForOptimisation(), Get_biomass_factor(), and Set_biomass_factor().
|
protected |
Vector containing values of initial (i.e. in year the data is taken for) crop areas at farms included in the simulation.
Referenced by Get_cropArea(), Get_cropAreasSize(), and Set_cropArea().
|
protected |
Vector storing parameters of all crop types.
Referenced by DataForOptimisation(), Get_cropParameter(), and Set_cropParameter().
|
protected |
Crop types saved as enumarator types (Bedriftsmodel i.e. original crop optimization model crop mode).
Referenced by Get_cropTypes(), and Set_cropTypes().
|
protected |
Crop types saved as enumarator types (ALMaSS crop mode).
Referenced by Get_cropTypes_almass(), Get_cropTypes_almass_size(), and Set_cropTypes_almass().
|
protected |
Vector with energy maize prices for each year of simulation.
Referenced by Get_emaize_price(), and Set_emaize_price().
vector<FarmData*> DataForOptimisation::m_farm_data |
Referenced by Get_farmType(), OptimisingFarm::Initialize(), and FarmManager::ReadFarmsData().
|
protected |
Crop Boolean parameter - fixed/variable crop. Farm type specific.
Referenced by DataForOptimisation(), Get_fixed(), and Set_fixed().
|
protected |
Crop Boolean parameter - fodder/non-fodder crop. Farm type specific.
Referenced by DataForOptimisation(), Get_fodder(), and Set_fodder().
|
protected |
Crop parameter: Fodder unit key, i.e. a number of fodder units obtained from a given crop [FU/hkg]. Farm type specific.
Referenced by DataForOptimisation(), Get_FUKey(), and Set_FUKey().
|
protected |
Vector containing numbers of all livestock types at farms included in the simulation.
Referenced by Get_livestockNumber(), Get_livestockNumbersSize(), and Set_livestockNumber().
|
protected |
Vector storing parameters of all livestock types.
Referenced by DataForOptimisation(), Get_livestockParameter(), and Set_livestockParameter().
|
protected |
Livestock types saved as enumarator types.
Referenced by Get_livestockTypes(), and Set_livestockTypes().
|
protected |
Maximum amount of fertilizer (N) that can be applied for a given crop [kg N/ha]. Soil specific.
Referenced by DataForOptimisation(), Get_Nnorm(), and Set_Nnorm().
|
protected |
Number of crops used in the simulation.
Referenced by Get_noCrops(), and Set_noCrops().
|
protected |
Maximum acreage of a crop at a farm [%]. Farm type, soil type and farm size specific.
Referenced by DataForOptimisation(), Get_rotationMax(), and Set_rotationMax().
|
protected |
Minimum acreage of a crop at a farm [%]. Farm type, soil type and farm size specific.
Referenced by DataForOptimisation(), Get_rotationMin(), and Set_rotationMin().
|
protected |
Selling price of a crop [DKK/hkg]. Farm type specific and soil type specific.
Referenced by DataForOptimisation(), Get_sellingPrice(), and Set_sellingPrice().
|
protected |
Selling price of a crop in a previous year [DKK/hkg]. Farm type specific and soil type specific.
Referenced by DataForOptimisation(), Get_sellingPrice_lastyr(), and Set_sellingPrice_lastyr().
|
protected |
Crop types saved in string format (Bedriftsmodel i.e. original crop optimization model crop mode).
Referenced by Get_cropTypes_str(), and Set_cropTypes_str().
|
protected |
Crop types saved in string format (ALMaSS crop mode).
Referenced by Get_cropTypes_almass_str(), and Set_cropTypes_almass_str().
|
protected |
Maximal area taken by winter crops at a farm. [%].
Referenced by DataForOptimisation(), Get_winterMax(), and Set_winterMax().